package com.tcs.init.impl;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.tcs.bean.init.IProxyBeanInit;
import com.tcs.cache.init.ICacheInit;
import com.tcs.init.IInitRun;
import com.tcs.service.IProxyService;
import com.tcs.validation.ITimingValidation;

public class InitRun implements IInitRun {
	
	private final Logger logger = LoggerFactory.getLogger(InitRun.class);
	
	@Resource(name="proxyService")
	private IProxyService proxyService;
	
	@Resource(name="iimingValidation")
	private ITimingValidation iTimingValidation;
	
	@Resource(name="cacheInit")
	private ICacheInit iCacheInit;
	
	@Resource(name="proxyBeanInit")
	private IProxyBeanInit iProxyBeanInit;
	
	@Override
	public void init() {
		try {
			iProxyBeanInit.init();
			iCacheInit.init();
			proxyService.work();
			iTimingValidation.validation();		// 定时读库验证删数据
		} catch (Exception e) {
			logger.error("" , e);
		}
	}

	@Override
	public void close() {};

}